import request from '@/utils/request'

export function add(data) {
  return request({
    url: 'api/yxStoreWriteCardMain',
    method: 'post',
    data
  })
}

export function downloadZip(id) {
  return request({
    url: 'api/yxStoreWriteCardMain/download' + '?id=' + id,
    method: 'get',
    responseType: 'blob'
  })
}

export function downloadCard(id) {
  return request({
    url: 'api/yxStoreWriteCard/download' + '?mainId=' + id,
    method: 'get',
    responseType: 'blob'
  })
}

export function del(ids) {
  return request({
    url: 'api/yxStoreWriteCardMain/',
    method: 'delete',
    data: ids
  })
}

export function edit(data) {
  return request({
    url: 'api/yxStoreWriteCardMain',
    method: 'put',
    data
  })
}

export default { add, edit, del, downloadZip, downloadCard }
